<template>
	<view class="wrap" style="padding-bottom: 120px;">
		<!-- <PdaScan></PdaScan> -->
		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<!-- 当前套餐 -->
		<view v-if="current === 0">

			<!-- <u-button type="primary" shape="circle" @click="scan1()">扫码</u-button> -->
			<!-- <u-row gutter="32" class="bottom-box" justify="center">
				<u-col span="10">
					<view><u-button type="primary" shape="circle" @click="sacn1()">扫码</u-button></view>
				</u-col>
			</u-row> -->
			<u-form :model="form">
				<view class="example-body">
					<u-gap height="20" bg-color="#f5f5f5"></u-gap>
					<u-form-item label="单据列表" label-width="150" right-icon="arrow-right">
						<u-input placeholder="去列表选择" type="button" @click="navTo('/pages/sys/outbound/list')"
							class="form-field-select" />
					</u-form-item>
					<u-form-item label="出库单号" label-width="150" right-icon="">
						<u-input v-model="inbillNo" placeholder="请输入出库单号或扫码" type="" class="" />
					</u-form-item>
					<u-gap height="20" bg-color="#f5f5f5"></u-gap>
				</view>

				<outbound-body :objdata="objdata"></outbound-body>

			</u-form>
			<u-row gutter="32" class="more-bottom-box" justify="center">
				<u-col span="10">
					<view><u-button class="more-button" type="primary" shape="circle" @click="scan1()">扫码</u-button>
					</view>
				</u-col>
				<u-col span="10">
					<view><u-button class="more-button" type="primary" shape="circle" @click="submit">下架</u-button>
						<!-- <u-button type="primary" shape="circle" @click="scan1()">扫码</u-button> -->
					</view>
				</u-col>

			</u-row>
		</view>
		<view v-if="current === 1">
			<view class="search">
				<u-search v-model="keywords" @custom="search" @search="search"></u-search>
			</view>
			<u-card class="task-list-item" :border="false" padding="20" margin="20rpx">
				<view slot="head" style="display: flex;align-items: center;justify-content: space-between;">
					<view style="display: flex;align-items: center;font-size: 30rpx;">
						<image class="user-images" src="/static/aidex/images/user06.png"></image>李毅的请假申请
					</view>
					<view style="color: #999999;font-size: 22rpx;">2021年10月24日</view>
				</view>
				<view class="" slot="body">
					<u-row gutter="16">
						<u-col span="12">
							<view class="apply-text"><span>假期类型：</span>年假</view>
						</u-col>
						<u-col span="12">
							<view class="apply-text"><span>开始时间：</span>2021年10月25日14:30</view>
						</u-col>
						<u-col span="12">
							<view class="apply-text"><span>结束时间：</span>2021年10月27日14:30</view>
						</u-col>
					</u-row>
				</view>
				<view class="apply-list-foot" slot="foot" style="text-align: right;color: #58ca93;">
					审批通过
				</view>
			</u-card>
			<u-card class="task-list-item" :border="false" padding="20" margin="20rpx">
				<view slot="head" style="display: flex;align-items: center;justify-content: space-between;">
					<view style="display: flex;align-items: center;font-size: 30rpx;">
						<image class="user-images" src="/static/aidex/images/user06.png"></image>李毅的请假申请
					</view>
					<view style="color: #999999;font-size: 22rpx;">2021年10月24日</view>
				</view>
				<view class="" slot="body">
					<u-row gutter="16">
						<u-col span="12">
							<view class="apply-text"><span>假期类型：</span>年假</view>
						</u-col>
						<u-col span="12">
							<view class="apply-text"><span>开始时间：</span>2021年10月25日14:30</view>
						</u-col>
						<u-col span="12">
							<view class="apply-text"><span>结束时间：</span>2021年10月27日14:30</view>
						</u-col>
					</u-row>
				</view>
				<view class="apply-list-foot" slot="foot" style="text-align: right;color: #58ca93;">
					审批通过
				</view>
			</u-card>
			<u-card class="task-list-item" :border="false" padding="20" margin="20rpx">
				<view slot="head" style="display: flex;align-items: center;justify-content: space-between;">
					<view style="display: flex;align-items: center;font-size: 30rpx;">
						<image class="user-images" src="/static/aidex/images/user06.png"></image>李毅的请假申请
					</view>
					<view style="color: #999999;font-size: 22rpx;">2021年10月24日</view>
				</view>
				<view class="" slot="body">
					<u-row gutter="16">
						<u-col span="12">
							<view class="apply-text"><span>假期类型：</span>年假</view>
						</u-col>
						<u-col span="12">
							<view class="apply-text"><span>开始时间：</span>2021年10月25日14:30</view>
						</u-col>
						<u-col span="12">
							<view class="apply-text"><span>结束时间：</span>2021年10月27日14:30</view>
						</u-col>
					</u-row>
				</view>
				<view class="apply-list-foot" slot="foot" style="text-align: right;color: #f28c03;">
					待审核
				</view>
			</u-card>
		</view>

	</view>
</template>
<script>
	import HeadNavBar from '@/components/headnavbar/index';
	// import InHead from '@/components/storage-body/in-head';
	// import ImportMsg from '@/components/storage-body/import-msg';
	// import HzMsg from '@/components/storage-body/hz-msg';
	// import MxMsg from '@/components/storage-body/mx-msg';
	import PdaScan from '@/components/pda/pda-sacn/pda-sacn';
	import OutboundBody from '@/components/outbound-body/outbound-body'
	export default {
		components: {
			HeadNavBar,
			// InHead,
			// ImportMsg,
			// HzMsg,
			// MxMsg,
			PdaScan,
			OutboundBody
		},

		data() {
			return {
				objdata: {
					type: 0,
					billno: '123456',
					location: '111-2-4-4',
					mxObject: {
						billno: '12Mx',
						type: '销退',
						bao: '测试包装传递'
					}
				},
				keywords: '',
				form: {},
				show: false,
				list: [{
					name: '下架'
				}, {
					name: '查看数据',
				}],
				m2mSimflowList: [],
				m2mOrderFlowList: [],
				current: 0,
				result1: '',
				status: 'loadmore',
				iconType: 'circle',
				isDot: false,
				loadText: {
					loadmore: '点击加载更多',
					loading: '正在加载...',
					nomore: '没有更多了'
				},
				inbillNo: '',
				nvueWidth: 730,
				only_one: [{
					text: '选择此项',
					value: 0
				}],
				// 基础表单数据
				baseFormData: {
					name: '',
					age: '',
					introduction: '',
					sex: 2,
					hobby: [5],
					datetimesingle: 1627529992399
				},
			}
		},
		onLoad(option) {
			this.inbillNo = option.id;
			// var _this = this
			//         uni.$on('scancodedate', function(content) {
			//             console.log("扫描到的内容为:", content)
			//             _this.content.push(content)
			//         })


		},
		created() {},
		methods: {
			scan1() {
				// #ifdef H5
				this.$u.toast('H5页面不支持扫码,请用安卓等移动设备重试')
				// #endif
				let that = this;
				// 允许从相机和相册扫码
				uni.scanCode({
					success: function(res) {
						that.inbillNo = res.result;
					}
				});
			},
			change(index) {
				this.current = index;
			},
			submit(index) {
				if (this.inbillNo) {
					this.$u.toast('调用上架接口')
				} else {
					this.$u.toast('请补充入库单号的数据')
				}
			},
			navTo(url) {
				uni.navigateTo({
					url: url
				});
			}
		}

	}
</script>
<style lang="scss" scoped>
	@import 'index.scss';

	page {
		background-color: #f5f5f5;
	}

	.wrap .search {
		background: #ffffff;
	}

	.apply-text {
		font-size: 28rpx;
		color: #333333;

		span {
			color: #999999;
		}
	}

	.user-images {
		width: 28px;
		height: 28px;
		margin-right: 8px;
	}

	.apply-list-foot {
		font-size: 28rpx;
	}

	.personnel-list {
		display: flex;
		align-items: center;
		flex-wrap: wrap;

		.personnel-user {
			position: relative;
			margin: 5px 9px 0;
		}

		.user-images {
			width: 48px;
			height: 48px;
			margin-right: 0;

		}

		.iconfont {
			position: absolute;
			top: -12px;
			right: -5px;
			color: #FE0100;
		}
	}

	.more-button {
		margin-top: 35rpx;
		// margin-bottom:15rpx;
	}
</style>